<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    watch:监控
    <input type="text" v-model="msg">
    watch:深监控
    <input type="text" v-model="user.name">





</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">

    let vue=new Vue({
        el:"#app",
        data:{
            msg:"",
            user:{
                name:"ldh"
            }
        },
        watch:{
            msg(newVal,oldVel){
                console.log(newVal,oldVel)
            },
            user:{
                deep:true,//不仅监控本身变化，还要监控对象内部变化
                handler(newobj){
                    console.log(newobj)
                }

            }
        }
    });

</script>
</body>
</html>